1. Field of the Invention
This invention relates to a method for detecting the position of an object. Specifically, this invention relates to a method of detecting the geometric relationship between two or more abutting objects, and more specifically, to such a detecting method as is particularly useful in detecting a limit line which is defined by two or more workpieces to be welded with the aid of a two-dimensional image sensor such as a television camera.
2. Description of the Prior Art
It has been heretofore known to use the "light shearing method" and "line approximation" in detecting a boundary between adjoining workpieces to be welded with the aid of a two-dimensional image sensor. According to the "light shearing method", a slit light image is projected across the boundary or adjoining workpieces to be welded, and the two-dimensional image sensor detects the projected light image which is deformed so as to be in conformity with the particular geometric characteristic of the boundary. Thus, the signal from the image sensor represents the geometric characteristic of the boundary to be welded. In the case of a fillet welding to be effected along the boundary between two adjoining workpieces as shown in FIG. 1, for example, the boundary to be welded can be detected from a slit light image which is projected across the boundary and is deformed in the straight-and-bent line. The boundary is represented in terms of the deformation of the slit light image.
"Line approximation" is one of the known methods used for automatically detecting a boundary between two or more adjoining workpieces to be welded. This method uses a two-dimensional image sensor and the signal from the image sensor representing light images on the boundary are mathematically processed to provide mathematical expressions of the boundary. If this method is used in combination with the light shearing method, two lines constituting a V-shaped light image (FIG. 2) is treated so as to provide two mathematical approximations for the two straight lines. Then, the intersection point of the two straight lines is calculated from the two mathematical equations thus derived.
Derivation of the approximate equations of the two intersecting lines, however, requires a large amount of calculation. In this connection the speed required in a welding operation will not be obtainable unless an inhibitably expensive processing apparatus is used. In the case of lap welding as shown in FIG. 3, however, the "light shearing method" plus "line approximation" is useless in detecting the limit line to be welded. Because two parallel-and-offset straight line light image appears in place of a V-shaped light image as shown in FIG. 4, Thus, it is impossible to detect the boundary in terms of the intersections of the two straight lines.
Recently there have been a variety of arc welding robots for automatically welding a train of workpieces one after another. In operation a sample workpiece is put in a predetermined position with respect to a given point on line of reference, and the tip of a welding torch is first manually moved along limit lines to be welded on the sample workpiece without performing actual welding so that the movement of the torch tip to be performed during the subsequent actual welding operation is stored in a memory. Then, an actual welding operation is performed by automatically moving the welding torch tip in accordance with the stored movement pattern of the welding torch. In this automatic welding operation, however, even a slight positional deviation of a workpiece from the point or line of reference makes it impossible for the welding torch to precisely trace the limit line to be welded on the workpiece. For the purpose of solving this problem, it might be considered to detect any deviation of a workpiece from the positional standard by a two-dimensional image sensor and an image processor and to correct accordingly the programmed movement of the welding torch. In order to detect the positional deviation it might also be considered to utilize the aforementioned light shearing method plus line-approximation. However, this is not satisfactory because, as mentioned hereinbefore, it is useless in the case of lap welding.
U.S. Pat. No. 3,766,355 which issued to E. Kottkamp on Oct. 16, 1973 is directed to the optical detection of a welding spot produced by a radiant welding beam and to the optical detection of a welding joint. The joint detector includes equipment 78 to provide an image of the workpiece and joint and to provide signals representing the relative position of the joint in the image plane. The detector signal is used as a reference for the control of the relative position of the welding spot.
A satisfactory recourse to detect any positional deviation of a workpiece from the standard position with a two-dimensional image sensor is to convert the picture image of boundary outputted from the image sensor into a corresponding binary picture image and to compare it with a binary reference picture image.
In putting this idea into practice, it might be considered to utilize the "correlation detection" which is used in comparison or analysis of waveforms. According to the "correlation detection", original information is "mapped" or shifted to a mathematical domain different from the coordinate domain of the original information through the agency of Fourier transform or the like. The term "original information" used here means information or data outputted from a two-dimensional or one-dimensional image sensor and still not subjected to any processing. Incidentally, whatever processing it might be, it always accompany "mapping" of the original information onto a mathematical plane different from the domain of the original information. Specifically, the processing accompanies inhomogeneous mapping and/or homogeneous mapping. The inhomogeneous mapping means to shift the original information to a mathematical plane of which at least one coordinate axis represents a mathematical quantity not appearing on any of coordinates of the original information, whereas the homogeneous mapping means to shift the original information to a mathematical plane having essentially the same coordinate axes as those of the original information.
Assuming that a television camera is used as the two-dimensional image sensor, the original information is given in a coordinate plane including X-axis, Y-axis and analog lightness axis. The vertical and the horizontal positions and the lightness of each picture element are given in terms of coordinates named in the order. If the original information is subjected to Fourier transform, the transformed information is on a mathematical plane having a real component axis, an imaginary component axis and a lightness axis. This can be called "inhomogeneous mapping" because of the imaginary component foreign to the original information.
When the analog lightness of each picture element is converted into binary lightness so that the original information is given on a mathematical plane having an X-axis, a Y-axis and a binary lightness axis, this can be called "homogeneous mapping". Becaue the analog lightness of the original information and the binary lightness of the mapped information are given on real number axes. "Homogeneous mapping" other than the analog-to-binary conversion are parallel transformation of picture image, rotation of pictue image, noise elimination of picture image, and derivation of a basic pattern from a picture image.
FIG. 5 shows an example of a deviation detecting system according to the correlation detection utilizing mapping by Fourier transform. The system shown utilizes the light shearing method for detecting any positional deviation of an object from the reference position. First, a reference object such as a sample workpiece to be welded is put at a predetermined or reference position. A slit light image is projected onto a limit line of welding and the projected and deformed slit light image is sensed by a two-dimensional image sensor, which in turn output a corresponding image information, whose lightness information is then converted into binary lightness information. The partially converted picture image information is stored as reference information through a writing device 10 in a memory 12. In FIG. 5, the part of workpiece to be welded, the light pattern projecting device, the two-dimensional image sensor and the analog-to-binary converter are omitted for the sake of simplification. Thus, the image information is stored in the memory 12 is discrete form, constituting the reference information f (x, y) (information concerning lightness is omitted for simplification of explanation) and each discrete information for each element is read out by a reading device 14 to direct to a Fourier transform device 16. The Fourier transform device 16 converts the received information f (x, y) into Fourier transformed information F (u, v), which is in turn fed to a modifying device 18. The information f (x, y) and the transformed information F (u, v) are in the following relation: ##EQU1## where x, y, u, v=0, 1, 2, . . . N-2, N-1
The modifying device 18 performs an operation on the information which operation causes the same effect as parallel transformation rotation of the information f (x, y) would have been performed in the x-y before shifting to the U-V plane. Specifically, the operation performed transformed information F (u, v) has the following meaning for the information f (x, y): ##EQU2## were x=r co .theta., y=r sin .theta.
u=w co .theta., v=w sin .phi.
In calculating the correlation between the reference information and the information of a workpiece under inspection if there should be little angular deviation of the workpiece with regard to the reference position it suffices that the parallel transformation of information is performed irrespective of the rotational relation between the two sets of information. Then, the operation of F (u, v) corresponding in effect to the rotational operation of f (x, y) is omitted. In this case, if the information of a workpiece under inspection and the reference information somewhat deviate from each other in a rotational direction, no real maximum value of the correlation degree will not result from the parallel transformation only. In such a case, it is preferable to subject one of the two sets of information to a process equivalent to widening each of the two intersecting lines of the slit light image as shown in FIG. 6A. A broadening device may be incorporated in the writing device 10 or the reading device 14. In case that the slit light image is too broad to provide a maximum value clearly discernible from the neighboring values of the correlation degree, no reliable detections is possible. In this case, it is preferable to subject one of the two sets of information to a process equivalent to making fine each of the two intersecting lines of the slit light image, as shown in FIG. 6B.
Information concerning the position of a workpiece is collected in a manner similar to collection of the reference information. Specifically a slit light image is casted onto a workpiece to be subjected to a welding operation, and a projected slit light image which varies with the positional deviation of the wrokpiece from the reference position is sensed by the two-dimensional image sensor. After partially converted into binary information, the picture image information from the image sensor is stored through a writing device 20 into a memory 22 in the form of discrete image information g (x, y). The information g (x, y) is read by a reading device 24 and is directed to a Fourier transform device 26, where the information g (x, y) is converted to a Fourier transformed information G (u, v). ##EQU3## where x, y, u, v=0, 1, 2 . . . N-2, N-1
A conjugate complex number computing device 28 converts the information G (u, v) into another kind of information G* (u, v), which is in conjugate complex number relation with G (u, v).
A multiplying device 30 performs the multiplication of the reference information F (u, v) by the positional information G* (u, v) so that the correlation C is derived. This is mathematically expressed by: EQU C=F(u, v).multidot.G*(u, v)
Again can be expressed in the x-y domain by: EQU C=f(x, y) C g(x,y),
where C is the correlation operator.
For determining the amount of deviation between the two kinds of information f (x, y) and g (x, y) it is necessary to substitute all possible different numbers for xo and yo in the following mathematical expression and to find the numbers for xo and yo which give the maximum correlation degree. EQU C=f(x-x.sub.o, y-y.sub.o) C g(x, y)
For carrying out this cutting-and-trying arithmetic operation in the U-V domain a maximum value computing device 32 is used to find out the values of xo and yo giving the maximum value according to the following equation: EQU C(x.sub.o, y.sub.o)=F(u, v) exp [-j2.pi.(uxo+vyo)/N]G*(u, v)
From the output of the maximum value computing device 32 the relative position of the workpiece with respect to the reference position can be recognized. In FIG. 5 there are means 34 for selectively holding and supplying the information of the limit line of welding in the reference information, means 36 for holding and supplying the information concerning the position and attitude of the two-dimensional image sensor with respect to a given reference, and means 38 responsive to signals from different means 18, 32, 34 and 36 for determining the amount of deviation of the limit line of welding on the workpiece from a reference position on which the limit line of welding should be positioned.
The aforementioned correlation finding-out through the agency of Fourier transform guarantees very high accuracy. However, it disadvantageously requies too large amount of calculation to permit the real time finding-out even with the aid of a fast Fourier transform (FFT) device.